//
//  CYHReadParser.h
//  CYHReader
//
//  Created by chenyh on 2016/9/26.
//  Copyright © 2016年 chenyh. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CYHReadConfig.h"

@interface CYHReadParser : NSObject

+ (CTFrameRef)parserContent:(NSString *)content config:(CYHReadConfig *)parser bounds:(CGRect)bounds;

+ (NSDictionary *)parserAttribute:(CYHReadConfig *)config;
//根据触摸点获取当前文字的索引
+ (CFIndex)parserIndexWithPoint:(CGPoint)point frameRef:(CTFrameRef)frameRef;
/**
 * 根据触摸点获取默认选中区域
 * @range 选中范围
 * @return 选中区域
 */

+ (CGRect)parserRectWithPoint:(CGPoint)point range:(NSRange*)selectRange frameRef:(CTFrameRef)frameRef;

/**
 *  根据触碰点获取默认选中区域
 *  @range 选中范围
 *  @return 选中区域的集合
 */

+ (NSArray *)parserRectsWithPoint:(CGPoint)point range:(NSRange *)selectRange frameRef:(CTFrameRef)frameRef paths:(NSArray *)paths;

/**
 *  根据触碰点获取默认选中区域
 *  @range 选中范围
 *  @return 选中区域的集合
 *  @direction 滑动方向 (0 -- 从左侧滑动 1-- 从右侧滑动)
 */

+(NSArray *)parserRectsWithPoint:(CGPoint)point range:(NSRange *)selectRange frameRef:(CTFrameRef)frameRef paths:(NSArray *)paths direction:(BOOL) direction;

@end
